package com.sixtwo.member.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RefreshScope
public class TestController {


    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping(value = "/echo/{id}", method = RequestMethod.GET)
    public String echo(@PathVariable Long id) {
        return restTemplate.getForObject("http://member-service/member/get/" + id, String.class);
    }
}
